[Top] [Prev] [Next] [Bottom] [Contents]

SaPopulateOptions

Populates option items with data.

Synopsis

#include "SaRnHtml.h"
void SaPopulateOptions(Widget list, 
				XtPointer client_data, 
				SaCallbackStruct *cbs);

Arguments

list
Not used.
client_data
Not used.
cbs
SaCallbackStruct callback structure containing the data.

Return Values

None.

Description

Populates option items with data. When using this call through use of the Object Bind Editor and an HTML template, the template fragment should look like this:

<SELECT NAME="Authors">
<OPTION>##Sa_authors##</OPTION>
</SELECT>
This call assumes that the select and at least one option item has been declared in the HTML template. This will produce one list item for each row in cbs. If more than one column is bound to the site, then each row will consist of columns concatenated. The columns are aligned by padding in spaces. They will only look aligned to the user if the list item is within <PRE> </PRE> tags. Also, the value retrieved and the value seen by the user are the same.

If you want these to be different, then a Sapphire/Web Loop construct would be needed. The HTML fragment is:

<SELECT NAME="Authors">
##Sa_BeginLoop##
<OPTION VALUE="##Sa_authorID##"</OPTION>##Sa_Authors##
##Sa_EndLoop##
</SELECT>

Example

/*** the following ad-hoc example can be used without templates 
**/
SaCallbackStruct *cbs;
cbs = SaExecSQL("CEZANNE", "pubs2", SGESYBASE, "select * from 
authors");
/***** print html, select, and option item headers *****/
SaPopulateOptions(NULL, NULL, cbs);
/*** print out end of select, option item and html headers ***/
SaFreeCbs(cbs);
Note: This call is generated automatically by Sapphire/Web through use of the Results Detail Dialog.

See Also



[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.